import {GameFrameworkEventArgs} from "../Base/GameFrameworkEventArgs";
import {ReferencePool} from "../Base/ReferencePool/ReferencePool";

export class WebRequestFailureEventArgs extends GameFrameworkEventArgs {
    get errorMessage(): string {
        return this._errorMessage;
    }

    get userData() {
        return this._userData;
    }

    get webRequestUri(): string {
        return this._webRequestUri;
    }

    get serialId(): number {
        return this._serialId;
    }

    private _serialId: number;
    private _webRequestUri: string;
    private _errorMessage: string;
    private _userData;

    public static Create(serialId: number, webRequestUri: string, errorMessage: string, userData): WebRequestFailureEventArgs {
        let webRequestFailureEventArgs: WebRequestFailureEventArgs = ReferencePool.Acquire(WebRequestFailureEventArgs);
        webRequestFailureEventArgs._serialId = serialId;
        webRequestFailureEventArgs._webRequestUri = webRequestUri;
        webRequestFailureEventArgs._errorMessage = errorMessage;
        webRequestFailureEventArgs._userData = userData;
        return webRequestFailureEventArgs;
    }


    constructor() {
        super();
        this._serialId = 0;
        this._webRequestUri = null;
        this._errorMessage = null;
        this._userData = null;

    }


    Clear(): void {
        this._serialId = 0;
        this._webRequestUri = null;
        this._errorMessage = null;
        this._userData = null;
    }


}